import React, { Component } from 'react'

export default class CommentInput extends Component {
  state = {
    content: '',
  }
  setTextarea = e => {
    this.setState({
      content: e.target.value,
    })
  }
  render() {
    return (
      <div className="comm-input">
        <textarea
          onChange={this.setTextarea}
          value={this.content}
          placeholder="爱发评论的人，运气都很棒"
        ></textarea>
        <div className="foot">
          <div className="word">0/100</div>
          <div
            className="btn"
            onClick={() => this.props.sendComments(this.state.content)}
          >
            发表评论
          </div>
        </div>
      </div>
    )
  }
}
